#pragma once

// Map class
//

#include <iostream>
#include <fstream>
#include <Windows.h>

#define MAX_LINE			256
#define MAX_TOKENS_PER_LINE	2

class Map
{
private:
	char**	mMap;
	int		mHeight;
	int		mWidth;
	
public:
	Map() : mMap(0), mHeight(0), mWidth(0) {}
	~Map();

	void Erase(); // deletes the data in the map

	int GetWidth() {return mWidth;};
	int GetHeight() {return mHeight;};
	char GetElement(int x, int y);
	void SetElement(int x, int y, char c);

	bool LoadFile(char* filename);

	// draws the map to the screen
	void Draw(void);
	// draws the map to a specific coordinate on the screen
	// x/y denotes the top-left coord
	void Draw(int x, int y);
	void DrawFlippedH(int x, int y);
	void DrawFlippedV(int x, int y);
	void DrawFlippedXY(int x, int y);
	void DrawRotatedCW(int x, int y);
	void DrawRotatedCCW(int x, int y);
	void DrawElement(char c);

	// these functions permanently change the map data
	void FlipH();
	void FlipV();
	void FlipXY();
	void RotateCW();
	void RotateCCW();

	// copies data from the target tetrad into this tetrad
	void Copy(Map &target);

};